package com.swq.java.code.chapter13.code13;

public class Machine extends Thread {
    public void run() {
        for (int a = 0; a < 3; a++) {
            System.out.println(currentThread().getName() + ":" + a);
//            System.out.println(this.getName() + ":" + a);
            yield();
        }
    }

    public static void main(String args[]) throws Exception {
        Machine machine = new Machine();
        machine.setName("m1");

        machine.start();
        machine.run();
    }
}
